bitkeeper revision 1.184.2.1 (3ead1db4N8KP6Exqh2ZYWow_4jjA3A)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 28 Apr 2003 12:25:24 +0000 (12:25 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Mon, 28 Apr 2003 12:25:24 +0000 (12:25 +0000)
Many files:
  IDE and SCSI devices are now accessed via /dev/hd? and /dev/sd? using the usual device numbers. XLIDE_MAJOR and XLSCSI_MAJOR have been removed, but XLVIRT_MAJOR remains (as do /dev/xvd?).

xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.c
xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_block.h
xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_ide.c
xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_scsi.c
xenolinux-2.4.21-pre4-sparse/arch/xeno/drivers/block/xl_segment.c
xenolinux-2.4.21-pre4-sparse/include/linux/major.h
xenolinux-2.4.21-pre4-sparse/init/do_mounts.c

index 1c8022375acd98d963b46194e118559d2ebdb322..d96037aa281fc13f926c099250d01114c76ccda5 100644 (file)
@@ -10,8 +10,6 @@
 
 typedef unsigned char byte; /* from linux/ide.h */
 
-#define XLBLK_MAX 32
-
 #define XLBLK_RESPONSE_IRQ _EVENT_BLK_RESP
 #define DEBUG_IRQ          _EVENT_DEBUG 
 
index 3d219eeedcd46b951c7beb76388fb6a8d26e1ba4..e0b9cf639170e8472d12240a15b02ccf1497c52d 100644 (file)
 #define DPRINTK_IOCTL(_f, _a...) ((void)0)
 #endif
 
-/* IDE/SCSI have <= 32 partitions per device. VIRT has <= 16. */
-#define PARTN_SHIFT(_dev) ((MAJOR(_dev)==XLVIRT_MAJOR) ? 4 : 5)
-#define XLIDE_PARTN_SHIFT  5
-#define XLSCSI_PARTN_SHIFT 5
+/* XL IDE and SCSI use same major/minor numbers as normal Linux devices. */
+#define XLIDE_MAJOR IDE0_MAJOR
+#define XLSCSI_MAJOR SCSI_DISK0_MAJOR
+
+/* IDE has < 64 partitions per device. VIRT and SCSI have < 16. */
+#define PARTN_SHIFT(_dev) ((MAJOR(_dev)==IDE0_MAJOR) ? 6 : 4)
+#define XLIDE_PARTN_SHIFT  6
+#define XLSCSI_PARTN_SHIFT 4
 #define XLVIRT_PARTN_SHIFT 4
 
+#define XLIDE_DEVS_PER_MAJOR  (256 >> XLIDE_PARTN_SHIFT)
+#define XLSCSI_DEVS_PER_MAJOR (256 >> XLSCSI_PARTN_SHIFT)
+#define XLVIRT_DEVS_PER_MAJOR (256 >> XLVIRT_PARTN_SHIFT)
+
 /*
  * We have one of these per XL-IDE, XL-SCSI, and XL-VIRT device.
  * They hang in an array off the gendisk structure. We may end up putting
index f8ff9dd79500a24f132e47c50555345b30096f1c..510a73805e7fcccec76d77ac6be7ddde83d74ccf 100644 (file)
@@ -2,7 +2,6 @@
  * xl_ide.c
  * 
  * Xenolinux virtual IDE block-device driver.
- * 
  */
 
 #include "xl_block.h"
@@ -10,9 +9,8 @@
 #define MAJOR_NR XLIDE_MAJOR 
 #include <linux/blk.h>
 
-/* We support up to 16 devices of up to 16 partitions each. */
 #define XLIDE_MAX         256
-#define XLIDE_MAJOR_NAME "xhd"
+#define XLIDE_MAJOR_NAME "hd"
 static int xlide_blksize_size[XLIDE_MAX];
 static int xlide_hardsect_size[XLIDE_MAX];
 static int xlide_max_sectors[XLIDE_MAX];
@@ -45,7 +43,9 @@ int xlide_init(xen_disk_info_t *xdi)
     units = 0;
     for ( i = 0; i < xdi->count; i++ )
         if ( IS_IDE_XENDEV(xdi->disks[i].device) &&
-             ((xdi->disks[i].device & XENDEV_IDX_MASK) < 16) ) units++;
+             ((xdi->disks[i].device & XENDEV_IDX_MASK) <
+              XLIDE_DEVS_PER_MAJOR) ) 
+            units++;
     if ( units == 0 ) return 0;
 
     SET_MODULE_OWNER(&xlide_block_fops);
@@ -112,8 +112,9 @@ int xlide_init(xen_disk_info_t *xdi)
        minor = disk << XLIDE_PARTN_SHIFT; 
 
 
-        /* We can use the first 16 IDE devices. */
-        if ( !IS_IDE_XENDEV(xdi->disks[i].device) || (disk >= 16) ) continue;
+        if ( !IS_IDE_XENDEV(xdi->disks[i].device) || 
+             (disk >= XLIDE_DEVS_PER_MAJOR) ) 
+            continue;
 
         ((xl_disk_t *)gd->real_devices)[disk].capacity =
             xdi->disks[i].capacity;
index 8daadf8791bfd4098ff759fc37e9092ab3272bba..f3d049238ff148ee4c6be2b0ed57a6df02d5491d 100644 (file)
@@ -2,7 +2,6 @@
  * xl_scsi.c
  * 
  * Xenolinux virtual SCSI block-device driver.
- * 
  */
 
 #include "xl_block.h"
@@ -10,9 +9,8 @@
 #define MAJOR_NR XLSCSI_MAJOR
 #include <linux/blk.h>
 
-/* We support up to 16 devices of up to 16 partitions each. */
 #define XLSCSI_MAX        256
-#define XLSCSI_MAJOR_NAME "xsd"
+#define XLSCSI_MAJOR_NAME "sd"
 static int xlscsi_blksize_size[XLSCSI_MAX];
 static int xlscsi_hardsect_size[XLSCSI_MAX];
 static int xlscsi_max_sectors[XLSCSI_MAX];
@@ -45,7 +43,9 @@ int xlscsi_init(xen_disk_info_t *xdi)
     units = 0;
     for ( i = 0; i < xdi->count; i++ )
         if ( IS_SCSI_XENDEV(xdi->disks[i].device) &&
-             ((xdi->disks[i].device & XENDEV_IDX_MASK) < 16) ) units++;
+             ((xdi->disks[i].device & XENDEV_IDX_MASK) <
+              XLSCSI_DEVS_PER_MAJOR) ) 
+            units++;
     if ( units == 0 ) return 0;
 
     SET_MODULE_OWNER(&xlscsi_block_fops);
@@ -110,8 +110,9 @@ int xlscsi_init(xen_disk_info_t *xdi)
     {
         disk = xdi->disks[i].device & XENDEV_IDX_MASK;
 
-        /* We can use the first 16 IDE devices. */
-        if ( !IS_SCSI_XENDEV(xdi->disks[i].device) || (disk >= 16) ) continue;
+        if ( !IS_SCSI_XENDEV(xdi->disks[i].device) || 
+             (disk >= XLSCSI_DEVS_PER_MAJOR) )
+            continue;
 
         ((xl_disk_t *)gd->real_devices)[disk].capacity =
             xdi->disks[i].capacity;
index 48848f901061be05ae103488c908a62b574d09c1..18b90ecbab1d8b5e76096bd623f1a05387faa86c 100644 (file)
@@ -13,7 +13,6 @@
 /* Copied from linux/ide.h */
 typedef unsigned char byte; 
 
-/* We support up to 16 devices of up to 16 partitions each. */
 #define XLVIRT_MAX        256
 #define XLVIRT_MAJOR_NAME "xvd"
 static int xlseg_blksize_size[XLVIRT_MAX];
@@ -119,8 +118,8 @@ int __init xlseg_init(void)
     {
         disk = xdi->disks[i].device & XENDEV_IDX_MASK;
 
-        /* We can use the first 16 IDE devices. */
-        if ( !IS_VIRTUAL_XENDEV(xdi->disks[i].device) || (disk >= 16) )
+        if ( !IS_VIRTUAL_XENDEV(xdi->disks[i].device) || 
+             (disk >= XLVIRT_DEVS_PER_MAJOR) )
             continue;
 
         ((xl_disk_t *)gd->real_devices)[disk].capacity =
index 6b22ee5812a1b71a05fe0b1853cf7137844f45b0..f311bd4a9d294cc7434caf49a281a8167cf8e048 100644 (file)
 #define        UMEM_MAJOR      116     /* http://www.umem.com/ Battery Backed RAM */
 
 /*
- * XLIDE/XLSCSI each support up to 8 devices of <= 32 partitions each.
  * XLVIRT supports 16 devices of <= 16 partitions each.
- * eg. xhda == (123, 0), xhdb == (123, 32), ...
- *     xsda == (124, 0), xsdb == (124, 32), ...
- *     xvda == (125, 0), xvdb == (125, 16), ...
+ * eg. xvda == (125, 0), xvdb == (125, 16), ...
  */
-#define XLIDE_MAJOR    123     /* XenoLinux IDE Device */
-#define XLSCSI_MAJOR   124     /* XenoLinux SCSI Device */
-#define XLVIRT_MAJOR    125     /* XenoLinux Virtual Device */
+#define XLVIRT_MAJOR    125
 
 #define RTF_MAJOR      150
 #define RAW_MAJOR      162
index 16aca7bb8ced07a317643452004e5338fe7855fc..377630ec3a5a29a07e3d3bdd6b99f57f25fc9918 100644 (file)
@@ -231,17 +231,6 @@ static struct dev_name_struct {
        { "ataraid/d14p",0x72E0 },
        { "ataraid/d15p",0x72F0 },
 #if defined(CONFIG_XENOLINUX_BLOCK)
-        /* XenoLinux IDE Devices */
-        { "xhda", 0x7B00 }, { "xhdb", 0x7B20 },
-        { "xhdc", 0x7B40 }, { "xhdd", 0x7B60 },
-        { "xhde", 0x7B80 }, { "xhdf", 0x7BA0 },
-        { "xhdg", 0x7BC0 }, { "xhdh", 0x7BE0 },
-        /* Xenolinux SCSI Devices */
-        { "xsda", 0x7C00 }, { "xsdb", 0x7C20 },
-        { "xsdc", 0x7C40 }, { "xsdd", 0x7C60 },
-        { "xsde", 0x7C80 }, { "xsdf", 0x7CA0 },
-        { "xsdg", 0x7CC0 }, { "xsdh", 0x7CE0 },
-        /* XenoLinux Virtual Devices */
         { "xvda", 0x7D00 }, { "xvdb", 0x7D10 },
         { "xvdc", 0x7D20 }, { "xvdd", 0x7D30 },
         { "xvde", 0x7D40 }, { "xvdf", 0x7D50 },